/**
 * 路由初始化
 * @module router/index
 */
import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
const router = new Router(routes)


router.beforeEach((to, from, next) => {
  // if (to.path === '/') {
  //   // console.log('首页')
  //   vue.$nextTick(() => {
  //     store.commit({
  //       type: `${NAV_STORE_NAME}/clear`
  //     })
  //     store.commit({
  //       type: `${NAV_STORE_NAME}/push`,
  //       tab: { label: '首页', name: to.path, closable: false }
  //     })
  //   })
  // }
  next()
});

Vue.use(Router)

export default router
